//
//  BQHomeSellTopCell.m
//  BeeQuick
//
//  Created by mac on 16/11/22.
//  Copyright © 2016年 six_group. All rights reserved.
//

#import "BQHomeSellTopCell.h"
#import "CZAdditions.h"
@implementation BQHomeSellTopCell
{
    NSMutableArray <UIButton *>*_arrM;
}


- (instancetype)initWithFrame:(CGRect)frame
{
    
    if(self = [super initWithFrame:frame])
    {
        
        [self setupUI];
    }
    return self;
    
}


- (void)setupUI
{
    
    self.backgroundColor = [UIColor whiteColor];
    
    UIImageView * TopImage = [[UIImageView alloc]init];
    
    TopImage.image = [UIImage imageNamed:@"top1"];
    

    [self.contentView addSubview:TopImage];
    
    UIImageView *leftImage = [[UIImageView alloc]init];
    
    leftImage.image = [UIImage imageNamed:@"top2"];
    [self.contentView addSubview:leftImage];
    
    UIImageView *right = [[UIImageView alloc]init];
    
    [self.contentView addSubview:right];
    
    right.image = [UIImage imageNamed:@"top3"];
    
    
    [TopImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.equalTo(self.contentView);
        make.height.mas_equalTo(60);
    }];
    
//
    [leftImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(10);
        make.top.equalTo(TopImage.mas_bottom);
        make.height.mas_equalTo(70);
        make.width.mas_equalTo(345*1.0/2);
    }];
    
    [right mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.mas_equalTo(70);
        make.width.mas_equalTo(400*1.0/2);
        make.top.equalTo(TopImage.mas_bottom);
        make.right.equalTo(self.contentView).offset(-10);
    }];
    
    
//    NSArray *titleArr = @[@"优选水果",@"牛奶面包",@"饮料酒水",@"更多"];
//    
//    NSArray *imgArr = @[@"youxuanshuiguo",@"niunaimianbao",@"yinliaojiushui",@"more"];
//    
//
//    for (NSInteger i = 0; i < 4 ; i++) {
//        
//        [self addButtonWithTitle:titleArr[i] andImgName:imgArr[i]];
//        
//        
//        
//    }
//    
// 
    
    
    
    
    
    
    
    
}
//
//- (void)addButtonWithTitle:(NSString*)title andImgName:(NSString*)imgName;
//{
//    
//    NSMutableArray *btnArr = [NSMutableArray array];
//    
//    UIButton *button = [[UIButton alloc]init];
//    //设置按钮文本
//    //    [button setTitle:title forState:UIControlStateNormal];
//    
//    //    [button setImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal];
//    
//    //imageWH 这里默认 是个正方形
//    [button setAttributedTitle:[NSAttributedString cz_imageTextWithImage:[UIImage imageNamed:imgName] imageWH:38 title:title fontSize:14 titleColor:[UIColor whiteColor] spacing:7] forState:UIControlStateNormal];
//    //这时候文字还没显示,因为没换行
//    
//    //    要让他换行//
//    button.titleLabel.numberOfLines = 0;
//    //设置对齐方式
//    //居中对齐
//    button.titleLabel.textAlignment = NSTextAlignmentCenter;
//    
//    [button sizeToFit];
//    
//    [self.contentView addSubview:button];
//    
//     [button addTarget:self action:@selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
//    [btnArr addObject:button];
//    
//    _arrM = btnArr.copy;
//    
//}
//- (void)clickButton:(UIButton *)btn
//{
//    NSLog(@"%@",btn.titleLabel.text);
//}
@end


